﻿SeadragonJSViewport = function(containerSize, contentSize) {
    /// <summary>Initializes a Viewport inside a container of the given size, for content of the given size. The content will initially be fitted snugly inside the viewport.</summary>
    /// <param name="containerSize" type="SeadragonJSPoint">Size of the container.</param>
    /// <param name="contentSize" type="SeadragonJSPoint">Size of the content.</param>
    /// <returns type="Object"></returns>
}

SeadragonJSRect.prototype =
{
    //Accessors
    getAspectRatio: function() {
        /// <summary>Returns the viewport's aspect ratio (width / height).</summary>
        /// <returns type="Number"></returns>
    },

    getContainerSize: function() {
        /// <summary>Returns the size of the viewport's container, in pixels.</summary>
        /// <returns type="SeadragonJSPoint"></returns>
    },

    getBounds: function(current) {
        /// <summary>Returns the viewport's bounds.</summary>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="SeadragonJSRect"></returns>
    },

    getCenter: function(current) {
        /// <summary>Returns the center of the viewport.</summary>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="SeadragonJSPoint"></returns>
    },

    getZoom: function(current) {
        /// <summary>Returns the zoom level of the viewport. This zoom level is the ratio of the content's width to the viewport's width, e.g. 1 means the widths are the same, 2 means the content's width is double the viewport's width, etc.</summary>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="Number"></returns>
    },

    //Methods
    ensureVisible: function(immediatly) {
        /// <summary>Zooms and pans to ensure that at least some content is ensured to be visible. The amount of the viewport ensured to be filled is defined by Seadragon.Config.visibilityRatio.</summary>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    fitBounds: function(bounds, immediatly) {
        /// <summary>Zooms and pans so that the given SeadragonJSRect is fitted into the viewport.</summary>
        /// <param name="bounds" type="SeadragonJSRect">Rect to fit.</param>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    goHome: function(immediatly) {
        /// <summary>Zooms and pans so that the content is fitted snugly into the viewport.</summary>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    panBy: function(delta, immediatly) {
        /// <summary>Pans the viewport by the given SeadragonJSPoint delta amount.</summary>
        /// <param name="delta" type="SeadragonJSPoint">How to pan by. (Dimensions)</param>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    panTo: function(center, immediatly) {
        /// <summary>Pans the viewport to the given center point.</summary>
        /// <param name="center" type="SeadragonJSPoint">Point to pan to.</param>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    zoomBy: function(factor, point, immediately) {
        /// <summary>Zooms by the given factor about the given point, which will remain at the same on-screen location through the zoom. If no point is given, zooms about the viewport center.</summary>
        /// <param name="factor" type="Number">Zoom factor to apply.</param>
        /// <param name="point" type="SeadragonJSPoint" optional="true">Point to set the zoom.</param>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    zoomTo: function(level, point, immediately) {
        /// <summary>Zooms to the given zoom level about the given point, which will remain at the same on-screen location through the zoom. If no point is given, zooms about the viewport center.</summary>
        /// <param name="factor" type="Number">Zoom level to apply.</param>
        /// <param name="point" type="SeadragonJSPoint" optional="true">Point to set the zoom.</param>
        /// <param name="immediatly" type="Boolean" optional="true"></param>
    },

    resize: function(containerSize, maintain) {
        /// <summary>Resizes the viewport to match the given container size in pixels. If maintain is true, the content's on-screen appearance is maintained relative to the viewport's origin, otherwise the content is resized relative to its center, such that the previously visible content remains visible.</summary>
        /// <param name="containerSize" type="SeadragonJSPoint">Point to pan to.</param>
        /// <param name="maintain" type="Boolean" optional="true"></param>
    },

    update: function() {
        /// <summary>Updates the viewport's current values and returns true if they have changed since the last update.</summary>
        /// <returns type="Boolean"></returns>
    },

    //Conversion Helpers
    deltaPixelsFromPoints: function(deltaPoints, current) {
        /// <summary>Converts the given normalized point delta to an on-screen pixel delta.</summary>
        /// <param name="deltaPoints" type="SeadragonJSPoint"></param>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="SeadragonJSPoint"></returns>        
    },

    deltaPointsFromPixels: function(deltaPixels, current) {
        /// <summary>Converts the given on-screen pixel delta to a normalized point delta.</summary>
        /// <param name="deltaPixels" type="SeadragonJSPoint"></param>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="SeadragonJSPoint"></returns>        
    },

    pixelFromPoint: function(point, current) {
        /// <summary>Converts the given normalized point to an on-screen pixel, relative to the viewport's container.</summary>
        /// <param name="point" type="SeadragonJSPoint"></param>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="SeadragonJSPoint"></returns>        
    },

    pointFromPixel: function(pixel, current) {
        /// <summary>Converts the given on-screen pixel, relative to the viewport's container, to a normalized point.</summary>
        /// <param name="pixel" type="SeadragonJSPoint"></param>
        /// <param name="current" type="Boolean" optional="true"></param>
        /// <returns type="SeadragonJSPoint"></returns>        
    }
}
